package com.ma5d.view;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

public class TestThread {
    public static void main(String[] args) throws Exception {
        Executor executor = Executors.newFixedThreadPool(10);
        int[] v = {0};
        for(int i=0; i<3; i++){
            v[0] = i;
            executor.execute(() -> {
                try {
                    Thread.sleep(1);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println(v[0]);
            });
        }

    }
}
